#!/usr/bin/env python
#encoding=utf8
"""
@描述：数据模型模块
@日期：2015年02月02日 星期一

@作者：hongxingfan
"""

import sys
sys.path.append("/home/wenxiubi/project/ScriptsCode/py_code/MySQL/")
from DBUtils import *
from DBArgs import *

class UserModel:
    # 静态方法
    @staticmethod
    def exist(userName,passwd):
        select = "SELECT COUNT(*) FROM test.USER WHERE userName=%s AND passwd=%s"
        selectParam = [userName,passwd]
        DB_127 = MySQLDB(DB127.host, DB127.user, DB127.passwd, DB127.port, DB127.charset)
        result = DB_127.select(select,selectParam)
        flag = False
        if len(result) > 0:
            flag = True
        DB_127.close()
        return flag

class ListHandler:

# 测试入口
if __name__ == "__main__":
    userName = "范洪星"
    passwd = "0909090909"
    flag = UserModel.exist(userName,passwd)
    print(flag)
